package com.springboot.demo.design.pattern.facade;

/**
 * 饮水Facade统一接口
 *
 * @author supu
 * @date 2019-07-16 14:09
 **/
public class DealOrderFacade {
    private Account account = new Account();
    private Order order = new Order();
    private Good good = new Good();

    public void createOrder() {
        //1、创建账户
        account.createAccount();
        //2、生成订单
        order.preOrder();
        //3、锁定库存
        good.lockStore();
    }

    public void payOrder() {
        //1、更新账户
        account.updateAccount();
        //2、更新订单
        order.issueOrder();
        //3、更新库存
        good.updateStore();
    }
}
